import { request } from "@/utils";

export function getChannelAPI() {
  return request({
    url: "/channels",
    method: "GET",
  });
}

export function submitPublishAPI(data) {
  return request({
    url: "/mp/articles?draft=false",
    method: "POST",
    data: data,
  });
}

// 获取文章列表
export function getArticleAPI(params) {
  return request({
    url: "/mp/articles",
    method: "GET",
    params,
  });
}

//删除
export function deleteAirticleAPI(id) {
  return request({
    url: `/mp/articles/${id}`,
    method: "DELETE",
  });
}

//  获取详情数据
export function getArticleDetailsAPI(id) {
  return request({
    url: `/mp/articles/${id}`,
    method: "GET",
  });
}
